<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			.box1,.box2{
				width: 100px;
				height: 100px;
				background: red;
			}
			.box1{
				margin-bottom: 30px;
			}
			.box2{
				margin-top: 30px;
			}
			.box3{
				width: 300px;
				height: 300px;
				background: orange;
			}
			.box4{
				width: 100px;
				height: 100px;
				background: red;
				margin-top: 50px;
			}
		</style>
	</head>
	<body>
		<div class="box1">我和下面的盒子距离只有30px</div>
		<div class="box2">我和上面的盒子距离只有30px</div>
		<div class="box3">
			<div class="box4">
				我的margin-top属性影响了我的父级元素
			</div>
			
		</div>
	</body>
</html>
